package com.xinxin.base.constant;

import com.xinxin.base.entity.ResultCode;
import org.springframework.http.HttpStatus;

/**
 * @author ys
 * @date 2021/5/18
 */
public interface ErrorCode {

    // 400
    ResultCode BAD_REQUEST = new ResultCode(HttpStatus.BAD_REQUEST.value(), "请求参数错误");
    // 401
    ResultCode UNAUTHORIZED = new ResultCode(HttpStatus.UNAUTHORIZED.value(), "认证失败");
    // 403
    ResultCode FORBIDDEN = new ResultCode(HttpStatus.FORBIDDEN.value(), "无操作权限");
    // 429
    ResultCode TOO_MANY_REQUESTS = new ResultCode(HttpStatus.TOO_MANY_REQUESTS.value(), "请求频繁");

    // 500
    ResultCode INTERNAL_SERVER_ERROR = new ResultCode(HttpStatus.INTERNAL_SERVER_ERROR.value(), "系统内部异常");
}
